package com.ruoyi.system.service.impl;

import com.ruoyi.common.annotation.DataScope;
import com.ruoyi.common.core.domain.entity.PracticePost;
import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.common.utils.ShiroUtils;
import com.ruoyi.system.mapper.PracticePostMapper;
import com.ruoyi.system.mapper.SysUserMapper;
import com.ruoyi.system.service.IPracticePostService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class PracticePostServiceImpl implements IPracticePostService
{

    @Autowired
    private PracticePostMapper postMapper;

    @Override
    @DataScope(deptAlias = "d",userAlias = "u")
    public List<PracticePost> selectPostList(PracticePost post) {
        return postMapper.selectPostList(post);
    }

    @Override
    public int insertPost(PracticePost post) {
        return postMapper.insertPost(post);
    }

    @Override
    public int updatePost(PracticePost post) {
        System.out.println(post);
        return postMapper.updatePost(post);
    }

    @Override
    public int deletePost(int id) {
        return postMapper.deletePost(id);
    }
}
